<admintpl file="headerEx"/>
<link href="__PUBLIC__/js/artDialog/skins/default.css" rel="stylesheet" />
<title>编辑菜单</title>
<!--responsive table-->
<link href="__PUBLIC__/TciocEx/css/table-responsive.css" rel="stylesheet"/>
<!--ios7-->
<link rel="stylesheet" type="text/css" href="__PUBLIC__/TciocEx/js/ios-switch/switchery.css" />

<!--icheck-->
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/minimal.css" rel="stylesheet">
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/red.css" rel="stylesheet">
<link href="__PUBLIC__/TciocEx/js/iCheck/skins/minimal/green.css" rel="stylesheet">
</head>
<body class="sticky-header">
<section>
	<!-- main content start-->
	<div class="full-content">
		<!-- body wrapper start -->
		<div class="wrapper">
			<div class="row">
				<div class="col-sm-12">
					<section class="panel">
						<header class="panel-heading custom-tab turquoise-tab">
							<ul class="nav nav-tabs">
								<li ><a href="{:U('nav/index')}"><i class="fa fa-list-ul"></i> {:L('ADMIN_NAV_INDEX')}</a></li>
								<li  ><a href="{:U('nav/add')}"><i class="fa fa-plus"></i> {:L('ADMIN_NAV_ADD')}</a></li>
								<li class="active" ><a href="{:U('nav/edit')}"><i class="fa fa-edit"></i> 编辑菜单</a></li>
							</ul>
						</header>
						<div class="panel-body">
							<div class=" form">
								<form class="cmxform form-horizontal adminex-form js-ajax-form" id="commentForm" method="post" action="{:U('nav/edit_post')}" novalidate="novalidate">
									<div class="form-group">
										<label  class="control-label col-lg-2">{:L('NAVIGATION_CATEGORY')}</label>
										<div class="col-lg-10">
											<select class=" input-lg "  name="cid" id="navcid_select" style="padding: 5px 16px;height: auto">
												<php>var_dump($navcats);var_dump($cid);</php>
												<foreach name="navcats" item="vo">
													<php>$navcid_selected=$navcid==$vo['navcid']?"selected":"";</php>
													<option  value="{$vo.navcid}" {$navcid_selected}>{$vo.name}</option>
												</foreach>
											</select>
										</div>
									</div>
									<div class="form-group">
										<label  for="parentid" class="control-label col-lg-2" >{:L('PARENT')}</label>
										<div class="col-lg-10" >
											<select class=" input-lg" name="parentid" id="parentid" style="padding: 5px 16px;height: auto">
												<option value="0">/</option>
												{$nav_trees}
											</select>
										</div>
									</div>
									<div class="form-group">
										<label for="label" class="control-label col-lg-2">{:L('LABEL')}(*)</label>
										<div class="col-lg-10">
											<input   class=" form-control" id="label" name="label" minlength="1" value="{$label}" type="text" required="" placeholder="请填写{:L('LABEL')}！">
										</div>
									</div>
									<div class="form-group">
										<label for="en_label" class="control-label col-lg-2">英文{:L('LABEL')}(*)</label>
										<div class="col-lg-10">
											<input   class=" form-control" id="en_label" name="en_label"  value="{$en_label}" type="text"  placeholder="请填写英文{:L('LABEL')}！">
										</div>
									</div>
									<!--<div class="form-group">-->
										<!--<label for="label" class="control-label col-lg-2">{:L('HREF')}(*)</label>-->
										<!--<div class="col-lg-10">-->
											<!--<input type="radio"  name="nav" id="outlink_radio">-->
											<!--<input type="text"  class=" form-control"  style="display: inline;width: auto"  style="width: auto" name="href" id="outlink_input" value="http://">-->
											<!--<input type="radio"   name="nav" id="selecturl_radio">-->
											<!--<select class=" input-lg " name="href" id="selecthref" style="padding: 5px 16px;height: auto">-->
												<!--<option value="{:base64_encode('home')}">{:L('HOME')}</option>-->
												<!--<foreach name="navs" item="vo">-->
													<!--<optgroup label="{$vo.name}">-->
														<!--{$vo.html}-->
													<!--</optgroup>-->
												<!--</foreach>-->
											<!--</select>-->
										<!--</div>-->
									<!--</div>-->

									<!--<div class="control-group">-->
										<!--<label class="control-label">{:L('HREF')}</label>-->
										<!--<div class="controls">-->
											<!--<input type="radio" name="nav" id="outlink_radio" checked="checked">-->
											<!--<input type="text" name="href" id="outlink_input" style="display: inline;width: auto" value="http://">-->
											<!--<input type="radio" name="nav" id="selecturl_radio">-->
											<!--<select name="href" id="selecthref" style="padding: 5px 16px;height: auto">-->
												<!--<option value="{:base64_encode('home')}">{:L('HOME')}</option>-->
												<!--<foreach name="navs" item="vo">-->
													<!--<optgroup label="{$vo.name}">-->
														<!--{$vo.html}-->
													<!--</optgroup>-->
												<!--</foreach>-->
											<!--</select>-->
										<!--</div>-->
									<!--</div>-->

									<div class="form-group">
										<label for="label" class="control-label col-lg-2">{:L('HREF')}(*)</label>
										<div class="col-lg-10">
											<input type="radio" name="nav" id="outlink_radio">
											<input type="text" name="href" id="outlink_input" value="http://" class="form-control" style="display: inline;padding: 5px 6px;width: auto;min-width: 15%">
											<input type="radio" name="nav" id="selecturl_radio">
											<select name="href" id="selecthref" class=" input-lg " style="padding: 5px 6px;height: auto">
												<option value="{:base64_encode('home')}">{:L('HOME')}</option>
												<foreach name="navs" item="vo">
													<optgroup label="{$vo.name}">
														{$vo.html}
													</optgroup>
												</foreach>
											</select>
										</div>
									</div>

									<div class="form-group">
										<label  for="target" class="control-label col-lg-2" >{:L('TARGET')}</label>
										<div class="col-lg-10">
											<select class=" input-lg "  name="target" id="target" style="padding: 5px 16px;height: auto">
												<option  <eq  name="target" value="1">selected = "selected"</eq> value="">{:L('TARGET_DEFAULT')}</option>
												<option  <eq  name="target" value="_blank">selected = "selected"</eq> value="_blank">{:L('TARGET_BLANK')}</option>
											</select>
										</div>
									</div>


									<div class="form-group">
										<label for="icon" class="control-label col-lg-2">{:L('ICON')}</label>
										<div class="col-lg-10">
											<input   class=" form-control" id="icon" name="icon"  value="{$icon}" type="text"  placeholder="请填写{:L('ICON')}！">
										</div>
									</div>
									<div class="form-group">
										<label for="cstatus" class="control-label col-lg-2">{:L('STATUS')}</label>
										<div>
											&nbsp;{:L('HIDDEN')} <input type="checkbox" class="js-switch"  id="cstatus" name="status" <php>  if($status){ echo "checked=checked"; } </php>data-switchery="true" style="display: none;"> {:L('DISPLAY')}
</div>
									</div>

									<div class="form-group">
										<div class="col-md-12 text-center clearfix">
											<input type="hidden" name="id" value="{$id}">
											<button class="btn btn-primary js-ajax-submit" type="submit">{:L('SAVE')}</button>
											<a href="javascript:history.back(-1);" class="btn btn-default">{:L('BACK')}</a>
										</div>
									</div>
								</form>
							</div>

						</div>
					</section>

				</div>
			</div>
		</div>
		<!--footer section start-->
		<footer>
			<admintpl file="copyright"/>
		</footer>
		<!--footer section end-->
	</div>
	<!-- main content end-->
</section>
<script src="__PUBLIC__/TciocEx/js/jquery-1.10.2.min.js"></script>
<script src="__PUBLIC__/js/wind.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="__PUBLIC__/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-migrate-1.2.1.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/modernizr.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/js/ajaxForm.js"></script>

<!--ios7-->
<script src="__PUBLIC__/TciocEx/js/ios-switch/switchery.js" ></script>
<script src="__PUBLIC__/TciocEx/js/ios-switch/ios-init.js" ></script>

<!--icheck -->
<script src="__PUBLIC__/TciocEx/js/iCheck/jquery.icheck.js"></script>
<script src="__PUBLIC__/TciocEx/js/icheck-init.js"></script>
<!--common scripts for all pages-->

<script type="text/javascript" src="__PUBLIC__/TciocEx/js/jquery.validate.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-localization/messages_zh.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/scripts.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-init.js"></script>

<script>
	$(function() {
		$("#navcid_select").change(function() {
			if(location.search.indexOf("?")>=0){
				location.href = location.href + "&cid=" + $(this).val();
			}else{
				location.href = location.href + "?cid=" + $(this).val();
			}
		});

		$("#selecthref,#selecturl_radio").click(function() {
			checkChange(2);
		});
		$("#outlink_input,#outlink_radio").click(function() {
			checkChange(1);
		});

		var opt = $("#selecthref option[value='" + '{$href}' + "']");
		if (opt.length > 0) {
			opt.attr('selected', 'selected');
			checkChange(2);
		} else {
			checkChange(1);
			$('#outlink_input').val('{$hrefold}');
		}

		function checkChange(i) {
			if (i == 1) {
				//自动输入url
				$('#outlink_input').attr('name', 'external_href');
				$('#selecthref').removeAttr('name');
				$('#outlink_radio').attr({
					'checked' : 'checked'
				});
			} else {
				//选择链接url
				$('#selecthref').attr('name', 'href');
				$('#outlink_input').removeAttr('name');
				$('#selecturl_radio').attr({
					'checked' : 'checked'
				});
			}
		}
	});
</script>



</body>
</html>